//
//  WHRDiagnoseResultVC.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/12/19.
//  Copyright © 2018 tzhg. All rights reserved.
////诊断结果

#import "WHRDiagnoseResultVC.h"

@interface WHRDiagnoseResultVC ()

@property (nonatomic , strong) UILabel *titleLabel;
@property (nonatomic , strong) UILabel *resultLabel;
@property (nonatomic , strong) UIButton *completeBtn;
@property (nonatomic , strong) UIButton *buyBtn;



@end

@implementation WHRDiagnoseResultVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupNavigationItems];
    [self creatView];
    [self setlayout];
    
    
}


- (void)creatView {
    
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textColor = COLOR_DIV;
    self.titleLabel.text = self.name;
    [self.view addSubview:self.titleLabel];
    
    self.resultLabel = [[UILabel alloc]init];
    self.resultLabel.text = self.content;
    self.resultLabel.textColor = COLOR_DIV;
    [self.view addSubview:self.resultLabel];
    
    
    self.completeBtn = [[UIButton alloc]init];
    self.completeBtn.titleLabel.font = FONT_FOURTEEN;
    self.completeBtn.backgroundColor  = COLOR_GREEN;
    [self.completeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.completeBtn setTitle:@"完成咨询" forState:UIControlStateNormal];
    [self.view addSubview:self.completeBtn];
    
    self.buyBtn = [[UIButton alloc]init];
    self.buyBtn.titleLabel.font = FONT_FOURTEEN;
    self.buyBtn.backgroundColor = COLOR_ORG;
    [self.buyBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.buyBtn setTitle:@"购买解决方案" forState:UIControlStateNormal];
    [self.view addSubview:self.buyBtn];
    
    
}

- (void)setlayout {
    
    self.titleLabel.sd_layout
    .leftSpaceToView(self.view, 10)
    .topSpaceToView(self.view, 100)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(20);
    
    self.resultLabel.sd_layout
    .leftSpaceToView(self.view, 10)
    .topSpaceToView(self.titleLabel, 10)
    .widthIs(SCREEN_WIDTH-20)
    .autoHeightRatio(0)
    .minHeightIs(40);
    
    self.buyBtn.sd_layout
    .rightSpaceToView(self.view, 20)
    .bottomSpaceToView(self.view,10)
    .widthIs(100)
    .heightIs(40);
    
    self.completeBtn.sd_layout
    .rightSpaceToView(self.buyBtn, 0)
    .bottomSpaceToView(self.view, 10)
    .widthIs(100)
    .heightIs(40);
    
    
}



- (void)setupNavigationItems {
    
    /** 导航条左边的按钮 */
    //返回按钮
    UIButton *kfBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [kfBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    kfBtn.frame = CGRectMake(0, 0, 30, 30);
    [kfBtn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:kfBtn];
    self.navigationItem.leftBarButtonItem = leftItem;
    /** 搜索 */
    UILabel *titleLabel = [[UILabel alloc]init];
    titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 30)];
    titleLabel.text = @"诊断结果";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.font = FONT_EIGHTEEN;
    titleLabel.textColor = [UIColor colorWithHex:0x29b566];
    self.navigationItem.titleView = titleLabel;
    
    
}


#pragma mark - Action

- (void)backAction:(UIBarButtonItem *)item {
    
    [self.navigationController popViewControllerAnimated:YES];
}



@end
